﻿using System.Collections.Generic;
using Moq;
using PluginFramework.Packages;
using PluginFramework.Plugins;

namespace PluginTests
{
	public class Setup
	{
		public static string PluginDir = @"..\..\Packages";
		public static string CacheDir = @"..\..\Cache";

		public static Mock<IPackageSettingsProvider> SettingsProvider()
		{
			var m = new Mock<IPackageSettingsProvider>();
			m.Setup(d => d.ReadPackageList()).Returns(new[] {"Plugin2"});
			return m;
		}

		public static void SetPackageManagerPath()
		{
			PackageManager.PluginDirectoryPath = PluginDir;
			PackageManager.CachePluginDirectoryPath = CacheDir;
		}

		public static Mock<IPluginRepository> PLuginRepository()
		{
			var p = new Mock<IPluginRepository>();
			p.Setup(d => d.GetActivePlugins()).Returns(new List<string>());
			return p;
		}
	}
}